//
//  QTopUpLabel.m
//  QoilPublic
//
//  Created by 杨凯 on 16/8/26.
//  Copyright © 2016年 杨凯. All rights reserved.
//

#import "QTopUpLabel.h"

@implementation QTopUpLabel

- (instancetype)initWithFrame:(CGRect)frame{

    self = [super initWithFrame:frame];
    if(self){
        [self createUI];
    }
    return self;
}

- (void)createUI{

    _lable_1 = [QViewUtility createLabelWithFrame:CGRectZero font:Ksize15 textAlignment:NSTextAlignmentCenter textColor:[UIColor blackColor] text:@""];
    [self addSubview:_lable_1];
    
//    _lable_2 = [QViewUtility createLabelWithFrame:CGRectZero font:Ksize13 textAlignment:NSTextAlignmentCenter textColor:[QColorUtility defaultRedColor] text:@""];
//    [self addSubview:_lable_2];
//    
//    _lable_3 = [QViewUtility createLabelWithFrame:CGRectZero font:Ksize12 textAlignment:NSTextAlignmentCenter textColor:[QColorUtility defaultDeepGrayColor] text:@""];
//    [self addSubview:_lable_3];


}
- (void)setMoneylab:(NSString *)moneylab{
    _moneylab = moneylab;
    _lable_1.frame = CGRectMake(0, self.frame.size.height/2-30, self.frame.size.width,18);
    _lable_1.centerY = self.height/2;
    _lable_1.text = _moneylab;
}

- (void)setTopModel:(QTopUpModel *)topModel{
    _topModel = topModel;
    _lable_1.frame = CGRectMake(0, self.frame.size.height/2-30, self.frame.size.width,18);
    _lable_1.centerY = self.height/2;
    _lable_1.text = [NSString stringWithFormat:@"%d元",[_topModel.payAmount intValue]];
    

}

- (void)setDataDic:(NSDictionary *)dataDic{

    _dataDic = dataDic;
    
    _lable_1.frame = CGRectMake(0, self.frame.size.height/2-30, self.frame.size.width,18);
    _lable_1.centerY = self.height/2;
    _lable_1.text = [NSString stringWithFormat:@"%@元",_dataDic[@"payAmount"]];
    
//    _lable_2.frame = CGRectMake(0, _lable_1.bottom+5, self.frame.size.width,14);
//    _lable_2.text = [NSString stringWithFormat:@"送%@",_dataDic[@"giftMoney"]];
//    
//    _lable_3.frame = CGRectMake(0, _lable_2.bottom+5, self.frame.size.width,13);
//    
//    NSString *countStr = _dataDic[@"count"];
//    if(countStr.integerValue > 0 && countStr.integerValue < 1000000){
//        _lable_3.text = [NSString stringWithFormat:@"剩余名额:%@",countStr];
//    }else if(countStr.integerValue == 1000000){
//        _lable_3.text = @"无限制";
//    }else{
//        _lable_3.text = @" ";
//    }
}

@end
